import json

from ronglian_sms_sdk import SmsSDK

accId = '2c94811c936de29c01937052c1b60031'
accToken = '4185028f86b04c15b97a88eab72d8f62'
appId = '2c94811c936de29c0193715f0f7900d3'

def send_message(phone,code):
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    mobile = phone
    datas = (code,)
    resp = json.loads(sdk.sendMessage(tid, mobile, datas))#默认的返回的是一个json格式 的字符串
    if resp['statusCode']=='000000':
        return True
    else:
        return False
# print(send_message('18749812616','1234'))